<!--
 * @Author: susu 1628469970@qq.com
 * @Date: 2023-05-19 09:50:46
 * @LastEditors: susu 1628469970@qq.com
 * @LastEditTime: 2023-05-29 14:30:30
 * @FilePath: \SUSU_CSS\web\SVG\7.htm
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<link rel="stylesheet" href="../common.css">
<style>
  body {
    background: #000;
  }
</style>

<body>
  <svg xmlns="http://www.w3.org/2000/svg" id="Calque_1" data-name="Calque 1" width="66.64" height="34" viewBox="0 0 66.64 34">
    <defs>
      <style>
        .cls-1 {
          fill: none;
          stroke: #fff;
        }
      </style>
    </defs>
    <path class="cls-1" d="M17.14,.5H49.71c2.67,0,5.23,1.07,7.11,2.97l6.43,6.5c3.86,3.9,3.86,10.17,0,14.07l-6.43,6.5c-1.88,1.9-4.44,2.97-7.11,2.97H17.14c-2.62,0-5.13-1.03-7-2.86l-6.64-6.5C-.5,20.22-.5,13.78,3.5,9.86L10.14,3.36c1.87-1.83,4.38-2.86,7-2.86Z" />
  </svg>
</body>
<script>
  function timeAdd0(str) {
    if (str.length <= 1) {
      str = "0" + str;
    }
    return str;
  }

  function getFormatTime(e = new Date()) {
    let nowYear = new Date(e).getFullYear().toString(),
      nowMonth = (new Date(e).getMonth() + 1).toString(),
      nowDay = new Date(e).getDate().toString(),
      nowHours = new Date(e).getHours().toString(), // 获取当前小时数(0-23)
      nowMin = new Date(e).getMinutes().toString(), // 获取当前分钟数(0-59)
      nowSeconds = new Date(e).getSeconds().toString(), // 获取当前秒数(0-59)
      obj = {};
    obj.nowYear = timeAdd0(nowYear);
    obj.nowMonth = timeAdd0(nowMonth);
    obj.nowDay = timeAdd0(nowDay);
    obj.nowHours = timeAdd0(nowHours);
    obj.nowMin = timeAdd0(nowMin);
    obj.nowSeconds = timeAdd0(nowSeconds);
    obj.nowDate = obj.nowYear + "-" + obj.nowMonth + "-" + obj.nowDay;
    obj.nowTime = obj.nowHours + ":" + obj.nowMin + ":" + obj.nowSeconds;
    obj.timeSfm =
      obj.nowYear +
      "-" +
      obj.nowMonth +
      "-" +
      obj.nowDay +
      " " +
      obj.nowHours +
      ":" +
      obj.nowMin +
      ":" +
      obj.nowSeconds;
    obj.monDay = obj.nowMonth + "月" + obj.nowDay + "日";
    obj.sfm = obj.nowHours + obj.nowMin + obj.nowSeconds;
    obj.todayStart = obj.nowDate + " " + "00:00:00";
    obj.todayEnd = obj.nowDate + " " + "23:59:59";
    return obj;
  }
  console.log(getFormatTime(
      new Date().getTime() - 24 * 60 * 60 * 1000,
    ).nowDate +
    " " +
    "00:00:00")
  console.log(getFormatTime().nowDate + " " + "23:59:59")

  const formatDateString = (e) => {
    return e.replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, "$1-$2-$3 $4:$5:$6");
  };
  formatDateString('20221123094122')
  console.log(formatDateString('20221123094122'))
  const date = '2023-05-26 23:59:59'
  console.log(new Date(date) >= new Date('2023-05-26 00:00:00') &&
    new Date(date) <= new Date('2023-05-26 23:59:59'))


  const formatDateString1 = (e) => {
    return e.replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\w+/, "$1-$2-$3 $4:$5:$6");
  };
  console.log(formatDateString1('20221123094122.mp4'))
  console.log(formatDateString1('20221123094122.png'))
  console.log(formatDateString1('20221123094122.jpg'))
</script>

</html>